package cn.bearspark.happening.provider.dao.buffer;

import cn.bearspark.framework.redis.starter.buffer.hash.un.RedisHashBuffer;
import cn.bearspark.happening.provider.dao.key.BookLiveBufferKeyBuilder;
import cn.bearspark.happening.provider.dao.co.BookLiveCO;
import cn.bearspark.happening.provider.dao.mapper.BookLiveMapper;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

/**
 * 预约直播的数据的缓存器
 *
 * @author f
 */
@Component
public class BookLiveHashBuffer extends RedisHashBuffer<BookLiveCO> {

    /**
     * 设置预约直播的数据的缓存的有效期（单位：s），默认是 10min
     */
    private static final int BOOK_LIVE_INFO_CACHE_EXPIRE = 60 * 10;

    public BookLiveHashBuffer(RedisTemplate<String, Object> redisTemplate,
                              BookLiveBufferKeyBuilder bookLiveCacheKeyBuilder,
                              BookLiveMapper bookLiveMapper) {
        super(
                redisTemplate,
                bookLiveCacheKeyBuilder,
                BOOK_LIVE_INFO_CACHE_EXPIRE,
                BookLiveCO.class,
                bookLiveMapper
        );
    }

}
